Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IFC-15 Support for mandatory/optional parent relationship #5561

Merged
merged 8 commits into from
Jan 27, 2025

Conversation

gmazoyer
Copy link
Contributor

Fixes #3682

This PR makes parent relationship mandatory in some cases.

The parent relationship becomes mandatory if the node depends on another one which is not itself or a generic of itself.

This allows, for instance, to not require a continent to have a parent while enforcing a
country to have a parent continent.

The parent won't be required if a node can depends on one of its own. For instance, an IP prefix can have a parent prefix, which is still optional as an prefix can live on its own.

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Jan 24, 2025
Copy link

codspeed-hq bot commented Jan 24, 2025

CodSpeed Performance Report

Merging #5561 will not alter performance

Comparing gma-20250122-3682 (cec33f3) with stable (261ec18)

Summary

✅ 10 untouched benchmarks

@gmazoyer gmazoyer force-pushed the gma-20250122-3682 branch 4 times, most recently from 7c230f5 to fda752c Compare January 27, 2025 07:15
@gmazoyer gmazoyer marked this pull request as ready for review January 27, 2025 07:15
@gmazoyer gmazoyer requested a review from a team January 27, 2025 09:42
@gmazoyer gmazoyer requested a review from a team January 27, 2025 12:27
@@ -633,7 +633,7 @@ def validate_schema_path(
and not (
schema_attribute_path.relationship_schema.name == "ip_namespace"
and isinstance(node_schema, NodeSchema)
and (node_schema.is_ip_address() or node_schema.is_ip_prefix)
and (node_schema.is_ip_address() or node_schema.is_ip_prefix())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😬

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's been here for quite a while 😬

The `parent` relationship becomes mandatory if the node depends on
another one which is not itself or a generic of itself. This allows, for
instance, to not require a continent to have a parent while enforcing a
country to have a parent continent. The parent won't be required if a
node can depends on one of its own. For instance, an IP prefix can have
a parent prefix, which is still optional as an prefix can live on its
own.
@gmazoyer gmazoyer merged commit d86130a into stable Jan 27, 2025
33 of 34 checks passed
@gmazoyer gmazoyer deleted the gma-20250122-3682 branch January 27, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Be able to use an hierarchical Parent/Ancestor as uniqueness_constraint
3 participants